<script setup>

import "../../assets/data"
import axios from 'axios'
import { ref } from "vue";
let list=ref(null)

axios.get('/api/psxq').then(res=>{
    list.value=res.data.data;
})
</script>

<template>
    <div class="spxq" v-for="(item,index) in list" :key="index">
        <div class="dd">
            <span>订单编号:{{ item.bianhao }}</span>
            <span>√</span>
        </div>
        <div class="spxi">
            <div>商品信息:</div>
            <div>{{item.spm[index]}}×1,{{item.spm[index+1]}}×2</div>
        </div>
        <div class="shxi">
            <div>收货人信息:</div>
            <div>
                <span>{{ item.name[index] }}</span>
                <div class="dh">
                    <img :src="item.img" alt="">
                    <span>打电话</span>
                </div>
            </div>
            <div>{{ item.dizhi }}</div>
        </div>
        <div class="shxi xx">
            <div>接货信息:</div>
            <div>
                <span>{{item.name[index+1]}}</span>
                <div class="dh">
                    <img :src="item.img" alt="">
                    <span>打电话</span>
                </div>
            </div>
            <div>{{ item.dizhi }}</div>
        </div>
        <div class="ma">
            <img :src="item.img" alt="">
        </div>
    </div>
</template>

<style scoped>
    .spxq{
        width: 90%;
        margin: 10px auto;
        padding: 15px;
        background-color: white;
        height: 550px;
    }
    .dd{
        display: flex;
        padding: 10px;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #ccc;
    }
    .dd>span:nth-child(1){
        font-size: 14px;
    }
    .dd>span:last-child{
        width: 20px;
        height: 20px;
        text-align: center;
        line-height: 20px;
        border-radius:999px;
        border: 1px solid black;
    }
    .spxi{
        padding: 10px;
        border-bottom: 1px solid #ccc;
    }
    .spxi>div:nth-child(1){
        font-size: 12px;
    }
    .spxi>div:nth-child(2){
        font-size: 16px;
        margin-top: 5px;
    }
    .shxi{
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        border-bottom: 1px solid #ccc;
    }
    .shxi img{
        width: 30px;
        height: 30px;
        border-radius: 999px;
    }
    .dh{
        display: flex;
        align-items: center;
        gap: 5px;
    }
    .shxi>div:nth-child(1){
        font-size: 12px;
    }
    .shxi>div:nth-child(2){
        display: flex;
        font-size: 16px;
        justify-content: space-between;
    }
    .shxi>div:nth-child(3){
        font-size: 16px;
        color:#aaa;
    }
    .xx{
        border: none;
    }
    .ma{
        margin: 0 auto;
        width: 100px;
        margin-top: 10px;
    }
    .ma>img{
        width: 100px;
        height: 100px;
    }
</style>